<!--
  ~ Copyright (c) 2019. SEA Gamer Mall Sdn Bhd.
  -->

<include file="./Admin/Tpl/Index/header.html"/>

<include file="./Admin/Tpl/Index/left.html"/>	


<script>

window.onload=function(){
var m = document.getElementById('selectResult');
 for(i=0;i<=m.options.length;i++)
 {  
  if(m.options[i].value=="<{$_GET['isexchange']}>")
  {      
   m.options[i].selected=true;   
   break;
  }
 }
}
			
function is_sure()
{
	if(confirm("确定要兑换吗？"))
	{
	    return true;
	}
	else
	{
	    return false;
	}
}

				$(function(){
				
				//提交表单
				$('img.search').click(function(){
					$('form[name="searchUserForm"]').submit();
				});
				
				$('#exportData').click(function(){
					
					
					var userphone='blank';
					var username='blank';
					var isexchange='blank';
					
					if($("#userphone").val()!=''){
						userphone =$("#userphone").val();
					}
					if($("#username").val()!=''){
						username =$("#username").val();
					}
					if($("#selectResult").val()!=''){
						isexchange =$("#selectResult").val();
					}

					window.location.href = "__APP__/User/exportRedpackData/userphone/"+userphone+"/username/"+username+"/isexchange/"+isexchange;
				});
			});
		</script>		
	<div class="diywap_right">

		<div class="well well-sm">红包记录</div>
					
					<form  name="searchUserForm" action="__APP__/User/searchRedpack"  method="get" >
		<div>
		
			<!--联系人:<input type='text' name='username' id="username" value="<{$_GET['username']}>"/>-->
			<!--联系电话: <input type='text' name='userphone' id="userphone" value="<{$_GET['userphone']}>"/>-->
			<!--是否兑换: <select name="isexchange" id="selectResult">  -->
		    	<!--<option value="">请选择</option>  -->
		        <!--<option value="1">已兑换</option> -->
		        <!--<option value="0">未兑换</option>	        -->
	       <!--</select> 		 -->
			<!--<button type="submit" class="btn btn-primary btn-lg" id="search">查询</button>-->

			<div class="btn btn-primary btn-lg" id="exportData" >导出数据</div>
			
		</div>
		</form>
		</br>
		
		<table class="table table-hover table-bordered">
			<tr>
				<th>序号</th>
				<th>用户wxid</th>
				<th>得分</th>
				<th>红包金额</th>
				<th>发放状态</th>
				 <th>发放结果</th>
				 <th>创建时间</th>
				 <th>发放时间</th>
			</tr>
			<volist name='data' id='vo'>
				<tr class="active">
					<td><{$vo.id}></td>
					<td><{$vo.wxid}></td>
					<td><{$vo.score}></td>
					<td><{$vo.amount}></td>
					<td><if condition="$vo.status eq 0 ">未发放
					    <elseif condition="$vo.status eq 1"/>已发放
					    <else />&nbsp;
					    </if></td>
					<td><{$vo.remark}></td>
					<td><{$vo.created}></td>
					<td><{$vo.updated}></td>
				</tr>
			</volist>

		</table>
		
		</br>
		<div style="text-align:center;"><{$page}></div>

			</div>

		

</div>

</body>

</html>